//
// Created by xili on 2024/9/23 19:38.
// GO BIG OR GO HOME.
//
#include "leetcode.h"

class SmallestInfiniteSet {
public:
    SmallestInfiniteSet() {
        for (int i = 1; i <= N; i++) {
            s.insert(i);
        }
    }

    int popSmallest() {
        int ans = *s.begin();
        s.erase(ans);
        return ans;
    }

    void addBack(int num) {
        s.insert(num);
    }

private:
    const int N = 1000;
    set<int> s;
};